
Use NEXUS_DB

GO
--------------------------------------Insert---------------
CREATE PROC insertCustormer
	@CustomerUserName varchar(255) ,
	@CustomerPassword varchar(255) ,
	@CustomerFullName nvarchar(255) ,
	@CustomerAddress nvarchar(500) ,
	@CustomerPhone varchar(20) ,
	@CustomerEmail varchar(255)
AS
INSERT INTO  Custormer(CustomerUserName,CustomerPassword,CustomerFullName,CustomerAddress,CustomerPhone,CustomerEmail)
 VALUES(@CustomerUserName,@CustomerPassword,@CustomerFullName,@CustomerAddress,@CustomerPhone,@CustomerEmail)

--insertAccount 'da',1,1,1
GO
---------------------------------------------------update-------------------
CREATE PROC updateCustormer
	@CustomerID int,
	@CustomerUserName varchar(255) ,
	@CustomerPassword varchar(255) ,
	@CustomerFullName nvarchar(255) ,
	@CustomerAddress nvarchar(500) ,
	@CustomerPhone varchar(20) ,
	@CustomerEmail varchar(255)
AS
UPDATE Custormer SET	
	CustomerUserName =@CustomerUserName,
	CustomerPassword =@CustomerPassword,
	CustomerFullName=@CustomerFullName,
	CustomerAddress =@CustomerAddress,
	CustomerPhone =@CustomerPhone,
	CustomerEmail =@CustomerEmail
WHERE CustomerID=@CustomerID
GO
---------------------------------------Delete--------------------

CREATE PROC deleteCustormer
	@CustomerID int
AS
	DELETE FROM Custormer WHERE CustomerID=@CustomerID
GO
CREATE PROC getAllCustormer
AS
SELECT * from Custormer
GO
----------------------GetAll-------------------------
CREATE PROC getAllCustomer
AS
	SELECT * from Custormer 
GO
------------------------------------ login-----------------------------------
CREATE PROC CustormerLogin
	@CustomerUserName varchar(255) ,
	@CustomerPassword varchar(255) 	
AS
SELECT * from Custormer where CustomerUserName=@CustomerUserName and CustomerPassword=@CustomerPassword
GO
--------------------------------------getCustomerByID--------------------
CREATE PROC getCustomerByID
	@CustomerID int
AS
	SELECT * from Custormer WHERE CustomerID=@CustomerID
